import Mock from 'mockjs'; // 引入mockjs
import Qs from 'qs';
const Random = Mock.Random;  // Mock.Random 是一个工具类，用于生成各种随机数据
const VITE_API_URL = import.meta.env.VITE_APP_BASE_API;


//  登录接口/mall4cloud_product/ua/index_img/list
Mock.mock(
  new RegExp(VITE_API_URL + '/mall4cloud_product/ua/index_img/list' + '.*'),
  'get',
  (options?: object): any => {
    let tempObj = Mock.mock({
      "spus|1-10": [
        {
          "spuId|+1": [
            Random.guid(),
            Random.guid(),
            Random.guid(),
          ],
          'imgUrl|+1':[
            Random.image('200x100', '#FF6600'),
            Random.image('200x100', '#FF6600'),
            Random.image('200x100', '#FF6600')
          ]
        }
      ]
    })
    let result = [  ...tempObj.spus ]
    
    console.log(result,'/mall4cloud_product/ua/index_img/list')
    return result
  }
)